package com.fankui.serviceedu.controller;

import com.fankui.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName EduLoginController
 * Description TODO
 * Date 2023/11/22 22:34
 *
 * @Author 范奎
 * @Since JDK 11
 */
@Api(description = "登录")
@RestController
@RequestMapping("/eduservice/user")
public class EduLoginController {
    @ApiOperation(value = "用户登录")
    @PostMapping("login")
    public R login() {
        return R.ok().data("token", "admin");
    }

    @ApiOperation(value = "获取用户信息")
    @GetMapping("info")
    public R info() {
        Map<String, Object> map = new HashMap<>();
        map.put("roles", "[admin]");
        map.put("name", "admin");
        map.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return R.ok().data(map);
    }
}
